
import os

f1=open('1.txt','r+')
st1=f1.read(1)
print(st1)
numtemp=0
'''
for index in st1:
    if index=="1":
        numtemp=numtemp+1
        print(numtemp)
print(numtemp)
'''
int=0
f1.seek(0,0)
for row in f1.readlines():
    for index in row:
        if index=='1':
            int=int+1

print(int)

st2=f1.read(1)
print(f1.tell())
st3=f1.read(4)
print(f1.tell())
st3=f1.read(6)
print(f1.tell())
print(st3)
print(st2)
print(f1.tell())
print(st3)

f1.seek(0,0)

for index in f1.readlines():
    print(index)

f1.seek(0,0)
print(f1.readline(2))
f1.seek(0,0)
print(f1.readlines(7))
f1.close()

